/**
 * Sample React Native App
 * https://github.com/facebook/react-native
 *
 * @format
 * @flow strict-local
 */

import React from 'react';
import {
    StyleSheet,
    View,
    Text,
    requireNativeComponent,
    Button,
    Picker,
    ScrollView,
} from 'react-native';
import RichTextView from './src/RichTextView';

const latexArr = [
    `AAAAAAAAAAAAAAAAAAAAAAAAAAA`,
    `Since $$\\psi=-\\frac{1}{\\varphi}$$, this formula can also be written asSince $$\\psi=-\\frac{1}{\\varphi}$$, this formula can also be written asSince $$\\psi=-\\frac{1}{\\varphi}$$, this formula can also be written asSince $$\\psi=-\\frac{1}{\\varphi}$$, this formula can also be written asSince $$\\psi=-\\frac{1}{\\varphi}$$, this formula can also be written asSince $$\\psi=-\\frac{1}{\\varphi}$$, this formula can also be written asSince $$\\psi=-\\frac{1}{\\varphi}$$, this formula can also be written asSince $$\\psi=-\\frac{1}{\\varphi}$$, this formula can also be written asSince $$\\psi=-\\frac{1}{\\varphi}$$, this formula can also be written asSince $$\\psi=-\\frac{1}{\\varphi}$$, this formula can also be written asSince $$\\psi=-\\frac{1}{\\varphi}$$, this formula can also be written asSince $$\\psi=-\\frac{1}{\\varphi}$$, this formula can also be written asSince $$\\psi=-\\frac{1}{\\varphi}$$, this formula can also be written asSince $$\\psi=-\\frac{1}{\\varphi}$$, this formula can also be written asSince $$\\psi=-\\frac{1}{\\varphi}$$, this formula can also be written asSince $$\\psi=-\\frac{1}{\\varphi}$$, this formula can also be written asSince $$\\psi=-\\frac{1}{\\varphi}$$, this formula can also be written asSince $$\\psi=-\\frac{1}{\\varphi}$$, this formula can also be written asSince $$\\psi=-\\frac{1}{\\varphi}$$, this formula can also be written asSince $$\\psi=-\\frac{1}{\\varphi}$$, this formula can also be written asSince $$\\psi=-\\frac{1}{\\varphi}$$, this formula can also be written asSince $$\\psi=-\\frac{1}{\\varphi}$$, this formula can also be written asSince $$\\psi=-\\frac{1}{\\varphi}$$, this formula can also be written asSince $$\\psi=-\\frac{1}{\\varphi}$$, this formula can also be written asSince $$\\psi=-\\frac{1}{\\varphi}$$, this formula can also be written asSince $$\\psi=-\\frac{1}{\\varphi}$$, this formula can also be written asSince $$\\psi=-\\frac{1}{\\varphi}$$, this formula can also be written as`,
];

export default class App extends React.Component {
    constructor(props) {
        super(props);
        this.state = {
            index: 0,
        };
    }

    onPress = () => {
        this.setState((prev) => {
            return {index: prev.index < latexArr.length - 1 ? prev.index + 1 : 0};
        });
    };

    render() {
        return (
            <ScrollView styles={{flex: 1}}>
                <Text>1111</Text>
                <Button onPress={this.onPress} title={'CHANGE TEXT'}/>
                <RichTextView math={latexArr[this.state.index]}/>
                <Text>2222</Text>
            </ScrollView>
        );
    }
}
const styles = StyleSheet.create({});
